import request from '@/utils/request'

export function getUserNoByIds (parameter) {
  return request({
    url: '/boss/admin/info/getUserNoByIds',
    method: 'get',
    params: parameter
  })
}
export function fetchUserList (parameter) {
  return request({
    url: '/boss/pms/admin/list',
    method: 'post',
    data: parameter
  })
}
export function requestAddUser (parameter) {
  return request({
    url: '/boss/pms/admin/add',
    method: 'post',
    data: parameter
  })
}
export function requestDeleteUser (parameter) {
  return request({
    url: '/boss/pms/admin/deleteById',
    method: 'post',
    data: parameter
  })
}
export function requestUpdateUser (parameter) {
  return request({
    url: '/boss/pms/admin/update',
    method: 'post',
    data: parameter
  })
}
// 研究者银行卡信息获取
export function getBankName (data) {
  return request({
    url: '/common/getBankName',
    method: 'post',
    data
  })
}

// 受试者银行卡信息获取
export function apiGetSubBankName (data) {
  return request({
    url: '/common/getBankName4PC',
    method: 'post',
    data
  })
}
// 受试者增加银行卡
export function addBank (data) {
  return request({
    url: '/boss/bank/add',
    method: 'post',
    data
  })
}

export function updateBank (data) {
  return request({
    url: '/boss/bank/update',
    method: 'post',
    data
  })
}

// 研究者增加银行卡
export function apiResearcherAddBank (data) {
  return request({
    url: '/boss/bank/researchAdd',
    method: 'post',
    data
  })
}
export function updateBankForResearch (data) {
  return request({
    url: '/boss/bank/updateBankForResearch',
    method: 'post',
    data
  })
}
export function getBankList (data) {
  return request({
    url: '/boss/bank/list',
    method: 'post',
    data
  })
}
export function canAuthorize (params) {
  return request({
    url: '/boss/bank/canAuthorize',
    method: 'get',
    params
  })
}
export function setDefaultBank (data) {
  return request({
    url: '/boss/bank/setDefault',
    method: 'post',
    data
  })
}
export function delBank (data) {
  return request({
    url: '/boss/bank/delete',
    method: 'post',
    data
  })
}
export function checkBank (data) {
  return request({
    url: '/boss/bank/checkBank',
    method: 'post',
    data
  })
}

/**
 * 设置研究者默认银行卡
 * @param data
 * @return {*}
 */
export function apiSetResBankDefault (data) {
  return request({
    url: '/boss/bank/setResearchDefault',
    method: 'post',
    data
  })
}

/**
 * 收款账户微信授权
 * @param params
 * @return {AxiosPromise}
 */
export function apiAuthorizeBank2WX (params) {
  return request({
    url: '/boss/project/manage/authorization',
    method: 'get',
    params
  })
}

export function apiGetLoginLogList (data) {
  return request({
    url: '/boss/login/log/pageList',
    method: 'post',
    data
  })
}

export function apiExportLoginLogExcel (data) {
  return request({
    url: '/boss/login/log/exportExcel',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

export function apiExportLoginLogPdf (data) {
  return request({
    url: '/boss/login/log/exportPdf',
    method: 'post',
    data,
    responseType: 'blob'
  })
}


export function apiGetOperatorLogList (data) {
  return request({
    url: '/boss/operate/log/pageList',
    method: 'post',
    data
  })
}

export function apiExportOperateLogExcel (data) {
  return request({
    url: '/boss/operate/log/exportExcel',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

export function apiExportOperateLogPdf (data) {
  return request({
    url: '/boss/operate/log/exportPdf',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

export function apiGetProjectNoList (params) {
  return request({
    url: '/boss/project/info/projectDropDownBox',
    method: 'get',
    params
  })
}

export function antiCheckForDigitalCoin (data) {
  return request({
    url: '/boss/bank/antiCheckForDigitalCoin',
    method: 'post',
    data
  })
}

// 小程序开关按钮
export function enableWechatBankAccount (data) {
  return request({
    url: '/boss/bank/enableWechatBankAccount',
    method: 'post',
    data
  })
}
